import { defineStore } from 'pinia';
import { Socket } from '../interface';

/**
 * websocket 根数据
 */
export const useSocket = defineStore('socket', {
    state: (): Socket => ({
        socketStatus: false,
        loginStatus: false
    }),
    actions: {
        // 更新socket 连接状态
        UPDATE_SOCKET_STATUS(status: any) {
            this.socketStatus = status
        },
        // 更新socket 登录状态
        UPDATE_LOGIN_STATUS(status:any) {
            this.loginStatus = status
        }
    }
})
